package com.code.day16;


import java.util.function.Consumer;

public class ConsumerLambda {
    public static void main(String[] args) {
        method(new Consumer<String>() {
            @Override
            public void accept(String s) {
                System.out.println(s.length());
            }
        }, "abcdefg");

        System.out.println("======================");

        method(s -> System.out.println(s.length()), "abcdefg");
    }

    public static void method(Consumer<String> consumer, String s) {
        consumer.accept(s);

    }
}
